package tan.dft.taphost;

import tan.dft.gps.Danhsachbiquanly;
import tan.dft.gps.Danhsachquanly;
import tan.dft.gps.R;
import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class AndroidTabLayoutActivity extends TabActivity {
	/** Called when the activity is first created. */
	private int idmayintent;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.maintabhost);

		Intent intent = getIntent();
		Bundle bundle = intent.getExtras();
		idmayintent = (Integer) bundle.getInt("idmay");
		Log.d("log", "log" + idmayintent);

		TabHost tabHost = getTabHost();

		// Tab for Photos
		TabSpec photospec = tabHost.newTabSpec("Photos");
		photospec.setIndicator("Quản Lý",
				getResources().getDrawable(R.drawable.icon_photos_tab));
		Intent photosIntent = new Intent(this, Danhsachquanly.class);

		Bundle bundle2 = new Bundle();
		bundle2.putInt("idmay", idmayintent);
		photosIntent.putExtras(bundle2);

		photospec.setContent(photosIntent);

		// Tab for Songs
		TabSpec songspec = tabHost.newTabSpec("Songs");
		// setting Title and Icon for the Tab
		songspec.setIndicator("Bị Quản Lý Bởi",
				getResources().getDrawable(R.drawable.icon_songs_tab));
		Intent songsIntent = new Intent(this, Danhsachbiquanly.class);
		Bundle bundle3 = new Bundle();
		bundle3.putInt("idmay", idmayintent);
		songsIntent.putExtras(bundle3);
		songspec.setContent(songsIntent);

		// Adding all TabSpec to TabHost
		tabHost.addTab(photospec); // Adding photos tab
		tabHost.addTab(songspec); // Adding songs tab
	}
}